
--[[
持续伤害模板
]]
local mt = ac.skill['永久献祭']
mt.art = [[ReplaceableTextures\CommandButtons\BTNImmolationOn.blp]]
mt.skill_type = 'passive'
mt.pulse = 1     --伤害间隔时间
mt.buff_name = '永久献祭'
mt.damage = 100
mt.area = 350

function mt:on_add()
    local hero = self.owner
    --有公式伤害/1秒刷新一次
    if self.data.damage then
        self:gc(ac.loop(1000,function()
            self.damage = self.damage
        end))
    end
    self:gc(hero:add_buff '光环'{
        area_type = 'enemy',
        aura_area = self.area,
        buff_name = self.buff_name,
        buff_data = {
            source = hero,
            pulse = self.pulse,
            on_pulse = function(buff)
                self:notify('on_hanle',hero,buff.owner)
            end,
        },
    })
end

function mt:on_hanle(hero,target)
    hero:create_damage(target,self.damage,'魔法') 
end

local buff = ac.buff['永久献祭']
buff.art = [[ReplaceableTextures\CommandButtons\BTNImmolationOn.blp]]
buff.tip = [[该单位处于狂热愤怒的作用之下，因此攻击力得到了加强，但是同时也会受到更多的伤害。]]
buff.effect_data = {
    ['head'] = [[Abilities\Spells\Other\ImmolationRed\ImmolationRedDamage.mdl]],
}
